python.pipInstallHook: avoid producing wrong direct_url.json file#229472
python.pipInstallHook: avoid producing wrong direct_url.json file#229472FRidh merged 1 commit intoNixOS:stagingfrom
Conversation
When installing many python packages, a `direct_url.json` file appeared in the lib directory. Example:
```sh
➤ nix build nixpkgs/29755fec55e58a315b517d431b2be261772f2b80#python3Packages.flask
➤ cat result/lib/python3.10/site-packages/Flask-2.2.3.dist-info/direct_url.json
{"archive_info": {}, "url": "file:///build/Flask-2.2.3/dist/Flask-2.2.3-py3-none-any.whl"}⏎
```
As you can see, that file contains a wrong reference to `/build`.
In https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012/4 there's an explanation on how to avoid this. Here, I'm implementing that change for nixpkgs.
@moduon MT-1075
FRidh
left a comment
There was a problem hiding this comment.
Nice, thanks!
How many packages did you test with this change?
|
I've tested like 4-5 packages. I was finding this problem for something I was packaging myself, and then found out that it happens on every package in nixpkgs. But of course I didn't check "every" package 😅 |
|
Thanks for merging! BTW other packages have a hook that check there are no references to |
|
Bisect claims that bff6c67 |
|
Hello, I can't reproduce because there's some dependency failing too. I'm checked out at today's DetailsHow may I proceed? |
|
|
|
If noone gets to understand the regressions within a couple days, I'll simply revert this (for now). We were in stabilization phase for 23.05 release and no "breaking changes" were allowed. /cc PR #232237 |
…file" Certain packages were failing since this was merged. #229472 (comment) This reverts commit bff6c67.
|
Pushed a revert to staging-next in f042784. |
|
Hold on, I found the fix. |
|
Fix in #232414. |
Fix problem detected in NixOS#229472 (comment). Since bff6c67, now pname is expected to match the name of the package that is built by Python standard tools.
Description of changes
When installing many python packages, a
direct_url.jsonfile appeared in the lib directory. Example:➤ nix build nixpkgs/29755fec55e58a315b517d431b2be261772f2b80#python3Packages.flask ➤ cat result/lib/python3.10/site-packages/Flask-2.2.3.dist-info/direct_url.json {"archive_info": {}, "url": "file:///build/Flask-2.2.3/dist/Flask-2.2.3-py3-none-any.whl"}⏎As you can see, that file contains a wrong reference to
/build.In https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012/4 there's an explanation on how to avoid this. Here, I'm implementing that change for nixpkgs.
@moduon MT-1075
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)